﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="test_View.aspx.cs" Inherits="Template.Web.Admin.test_View" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
        </div>
    </form>
    <script>
        $(document).ready(function () {
            'use strict';
            // 配置插件    
            var myViewPlugin = new ViewPlugin({
                // 处理程序url        
                handlerUrl: 'handler/userHandler.ashx',
                // 返回页面url        
                returnPageUrl: 'user_list.aspx?state=has',
                // 获取详情额外参数        
                viewParams: {
                    action: 'detail',
                    id: myUtil.getUrlParam('id')
                },
                // 页面控件        
                pageControls: [{
                    controlID: '#userName',
                    // 赋值需要特殊处理的，添加reset属性，element指这个$('#userName')对象，value是值                
                    reset: function (element, value) {
                        return '<span class="danger">' + value + '</span>';
                    }
                }, { controlID: '#age' }, ]
            });
            // 重写单击事件绑定(默认有返回按钮事件)    
            //myViewPlugin.bindClickEvent = function () {    
            //    $('#btnReturn').on('click', function () {    
            //        window.self.location.href = 'user_list.aspx?state=has';    
            //    });    
            //};    
            // 初始化插件    
            myViewPlugin.init();
        });

    </script>
</body>
</html>
